home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d17 / lptcom02.arc / LPTCOM.DOC < prev    next >
Text File  |  1988-04-19  |  5KB  |  108 lines

  1.                                      LPTCOM
  2.                                      ======
  3.  
  4.   A serial line printer driver for MS-DOS/PC-DOS systems that use printers
  5. with XON/XOFF flow control through one of the COM ports.
  6.  
  7. Introduction
  8. ============
  9.  
  10.   Most printers (but not all) that are used by PC's are attached in one of two
  11. possible ways; on the parallel printer port or on a serial communications port.
  12. Historically, when a serial port is used, one of the control leads is used by
  13. the printer to signal when it is busy, and unable to receive more characters to
  14. print, or ready, when it is available for more characters.  However, some
  15. printers do not employ this technique, relying on a more communications-
  16. oriented method called XON/XOFF.  In this method, the printer, using the
  17. receive data signal into the PC transmits the XOFF character (hex 13) when it
  18. needs to declare BUSY and then sends the XON character (hex 11) when it needs
  19. to declare READY.
  20.  
  21.   Neither the standard printer LPT driver nor the communications COM driver
  22. recognize this signalling protocol.  Typically, when a printer is attached to
  23. a COM port, all you need to do is issue the MODE LPT:=COM1: command and all I/O
  24. directed to the LPT device is instead re-directed to the COM1 device.  However,
  25. the XOFF from the printer gets ignored and the printer's buffer readily gets
  26. overrun (usually causing the printer to spasm with 'beeps').  Output is
  27. directed to the printer driver (and redirected to COM1) using the DOS print
  28. services (interrupt number 17).  LPTCOM is a simple program (terminate-stay-
  29. resident) that takes over this interrupt and manipulates the transmit and
  30. receive functions of the COM port to send data to the printer and also receive
  31. XON/XOFF signals from the printer.
  32.  
  33.   Even if you are not a PC wizard, you should be able to read the simple code
  34. and get the gist of how it works.
  35.  
  36. How to use LPTCOM
  37. =================
  38.  
  39.   There are two programs of which you will only need one, depending on which
  40. COM port your printer is attached.  LPTCOM1 will direct LPT output to COM1 and
  41. LPTCOM2 will direct output to COM2.  You will probably use one of the two
  42. command sequences listed below.
  43.  
  44.        if your printer is on COM1               if your printer is on COM2
  45.  
  46.         MODE COM1: 4800,N,8,1,P                 MODE COM2: 4800,N,8,1,P 
  47.         LPTCOM1                                 LPTCOM2
  48.  
  49.   If you don't understand the MODE command, I'd suggest that you look it up in
  50. your DOS reference manual so that the communications parameters match your
  51. printer's.  I'd also suggest putting the appropriate commands in AUTOEXEC.BAT
  52. so you won't have to do this each time you start up your PC.  Remember to put
  53. LPTCOM1.COM or LPTCOM2.COM in the root directory or in a directory on the PATH
  54. so that it is available for execution.
  55.  
  56. What to avoid
  57. =============
  58.  
  59. Since LPTCOM is executed as a stay resident program, I do not suggest running
  60. it more than once.  A subsequent execution won't hurt but the previous LPTCOM
  61. run will remain in memory without providing any functionality since the new
  62. LPTCOM has taken over the printer vector.
  63.  
  64. Limitations
  65. ===========
  66.  
  67. LPTCOM will ignore any printer designation (LPT1,LPT2, etc).  If you have more
  68. than one printer on your system, you will have to modify LPTCOM yourself.  Good
  69. luck.
  70.  
  71. If your printer issues an XOFF without an XON later, such as when you switch it
  72. off in the middle of a print jam, your system will hang.  However, that's what
  73. DOS does now anyway so why worry ?
  74.  
  75.  
  76. good computing !
  77.  
  78. FRSW
  79.  
  80. Toad Hall Comments:
  81.  
  82. My compliments to the original author for the decency of releasing
  83. the source code.  Such release permit full understanding, adapting to
  84. local conditions, and (hopefully) improvements.
  85.  
  86. My changes  (commented in the new source):
  87. 1.  Tweaked assembler source is LPTCOM02.ASM (version 0.2).
  88. 2.  Compiled versions for COM1 and COM2 are LPTCOM12.COM and LPTCOM22.COM,
  89.     respectively.
  90. 3.  LPTCOM will now test to see if it's already installed.
  91.     If resident for the same port (COM1 or COM2), it will issue a
  92.     warning message ("Already installed for port %") and abort.
  93.     (Errorlevel returned will be the installed port (1 or 2)
  94.     if you're running in a batch file.)
  95.     If already resident for the OTHER port, it will issue the same
  96.     warning message, but will go right ahead and "re-install" itself
  97.     for the new port (pre-empting the previously installed LPTCOM).
  98.     (Errorlevel returned will be 0.)
  99.  
  100. I'd like to return the upgraded code to the author, but don't know how
  101. to reach him.  If anyone happens to know where he is and can forward
  102. the new assembler source and documentation to him, I'm sure he'd
  103. appreciate it.
  104.  
  105. David P Kirschbaum
  106. Toad Hall
  107. kirsch@braggvax.ARPA
  108.